<template>
    <div>
       <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="val in list" :key="val.id">
					<a  @click="$router.push({path:`/home/newsinfo/${val.id}`})">
						<img class="mui-media-object mui-pull-left" :src="val.img_url">
						<div class="mui-media-body">
							<h1>{{val.title}}</h1>
							<p class='mui-ellipsis'>
                                <span>发表时间：{{val.add_time | dtaFormat}}</span>
                                <span>点击：{{val.click}}次</span>
                            </p>
						</div>
					</a>
				</li>				
			</ul>
    </div>
</template>
<script>
import axios from 'axios'
import {Toast} from 'mint-ui'
    export default {
        data(){
            return {
                list:[]
            }
        },
        created() {
            this.loadMore1()
        },
        methods:{
            loadMore1() {
                    axios({
                    method:'get',
                    url:'http://www.liulongbin.top:3005/api/getnewslist'
                }).then(res=>{
                    if(res.data.status===0){
                        this.list=res.data.message
                    }else{
                        Toast("请求地址不存在")
                    }
                })                
        }
        }
        }
</script>
<style lang="scss" scoped>
.mui-table-view{
    
    li{
        h1{
            font-size: 14px;
        }
        .mui-ellipsis{
            color: blue;
            font-size: 12px;
            display: flex;
            justify-content: space-between;
        }
    }
}
</style>
